import pygame
import random
import easygui

image_mouse_player_1 = r"Release\Sprites\hero\fly\hero1.png"
image_mouse_player_2 = r'Release\Sprites\hero\fly\hero2.png'
image_background = r'Release\Images\background.png'
image_pa = r'Release\Sprites\bullet\fly\bullet2.png'
image_enemy = r'Debug\Sprites\Enemy1\fly\enemy1.png'
image_enemy_2 = r'Debug\Sprites\Enemy1\down\enemy1_down1.png'
image_enemy_3 = r'Debug\Sprites\Enemy1\down\enemy1_down2.png'
image_enemy_4 = r'Debug\Sprites\Enemy1\down\enemy1_down3.png'
image_enemy_5 = r'Debug\Sprites\Enemy1\down\enemy1_down4.png'
image_player1 = r'Debug\Sprites\hero\down\hero_blowup_n1.png'
image_player2 = r'Debug\Sprites\hero\down\hero_blowup_n2.png'
image_player3 = r'Debug\Sprites\hero\down\hero_blowup_n3.png'
image_player4 = r'Debug\Sprites\hero\down\hero_blowup_n4.png'
image_enemy2_1 = r'images2\enemy2.png'
image_enemy2_2 = r'images2\enemy2_hit.png'
image_enemy2_3 = r'images2\enemy2_down1.png'
image_enemy2_4 = r'images2\enemy2_down2.png'
image_enemy2_5 = r'images2\enemy2_down3.png'
image_enemy2_6 = r'images2\enemy2_down4.png'
image_gift = r'images2\bullet_supply.png'
image_not_stop = r'Debug\Images\game_pause_nor.png'
image_not_pressed = r'Debug\Images\game_pause_pressed.png'
image_stop = r'Debug\Images\game_resume_nor.png'
image_stop_pressed = r'Debug\Images\game_resume_pressed.png'
image_max_pa = r'Debug\Sprites\bullet\fly\max_bullet.png'
image_loading1 = r'Debug\Images\loading1.png'
image_loading2 = r'Debug\Images\loading2.png'
image_loading3 = r'Debug\Images\loading3.png'
image_start_name = r'Debug\Images\start_name.png'

l = 480
w = 852
number = 0
player_pos = [240, 426]

pygame.mixer.init()

max_rate = 60  # 最大帧数

time_rate = 30  # 周期帧数
ticks = 0
clock = pygame.time.Clock()

# 玩家坠毁索引
player_down_index = 1

# 初始化
pygame.init()
screen = pygame.display.set_mode((l, w), 0)
pygame.display.set_caption('于志翔的飞机大战')

# 载入图片K:\pycharm\pycharm\飞机大战\


# 导入音乐
song = pygame.mixer.music.load('音乐\孟可 - 追赶.mp3')

# 字体K:\pycharm\pycharm\飞机大战\
font = r'fonts\FZDBSJW.TTF'
myfont = pygame.font.Font(font, 20)

black = (0, 0, 0)

n = 0

player_plane1 = pygame.image.load(image_mouse_player_1).convert_alpha()
player_plane2 = pygame.image.load(image_mouse_player_2).convert_alpha()
